package com.atguigu.mybatisplus.service.impl;

import com.atguigu.mybatisplus.entity.User;
import com.atguigu.mybatisplus.mapper.UserMapper;
import com.atguigu.mybatisplus.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    /**
     * 一般方法注入Mapper，实际上UserMapper继承自baseMapper
     * 如果调用在当前业务层所涉及到的持久层Mapper对象，并不需要额外的注入，直接用baseMapper即可
     */
//    @Resource
//    private UserMapper userMapper;


    @Override
    public List<User> listAllByName(String name) {

        return baseMapper.selectAllByName(name);
    }

}
